package txts

import org.apache.spark.sql.SparkSession

object TextApp {
  def main(args: Array[String]): Unit = {
    val spark = SparkSession.builder()
      .appName("TextApp")
      .master("local")
      .getOrCreate()

    //只要写到包名就可以了...sql.text，不用这样写...sql.text.DefaultSource
//    val df = spark.read.text("E:\\IdeaProjects\\hzw02demos\\hzw02demos-spark\\src\\main\\scala\\data.txt")

    val df = spark.read.format("txts").option("path","D:\\projects\\wyt01utils\\wyt01-spark\\src\\main\\scala\\data.txt").load()

    df.show()

    spark.stop()
  }
}
